using System.Collections.Generic;
using KamLib;

namespace Ext.Net.UIS
{
    public class NumberFieldEditor : TermEditor
    {
        public static NumberFieldEditor Default = new NumberFieldEditor();
        public override IEnumerable<AbstractComponent> NewControls(TermNode node, UisCreateControlArgs e) {
            return 
                node.Term.DataType.IsAssignableFrom(typeof(double)) ? this.NewFieldControls<FloatField>(node, e) : 
                this.NewFieldControls<IntField>(node, e);
        }
    }
}